<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="com.hertz.appr.service.ActionService"%>
<%@page import="com.hertz.appr.pojo.db.Action"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="net.sf.json.JSONArray"%>
<%@page import="org.springframework.web.util.HtmlUtils"%>
<%String callback = request.getParameter("callback");
String no = request.getParameter("no");
if(StringUtils.isBlank(no) || !StringUtils.isNumeric(no)){
	no = "10";
}
Integer num = Integer.valueOf(no);
String msg = "();";
ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletConfig().getServletContext());
ActionService actionService = (ActionService)ctx.getBean("actionService");
List<Action> list =actionService.getActions(Action.ACTION_STATUS_START);
if(list != null && list.size() != 0){
	if(num > list.size()){
		num = list.size();
	}
	list = list.subList(0,num);
	JSONArray ja = JSONArray.fromObject(list);
	msg = ja.toString();
	msg = "(" + msg + ")";
}
msg = callback + msg;
%>
<%=msg %>


